@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700');
@import url('https://fonts.googleapis.com/css?family=Ubuntu+Mono');

* {
  margin: 0;
  padding: 0;
  font-family: 'Open Sans', sans-serif;
}
body {
  text-align: center;
  background-color: #faf8ef;
}

div.app > h1 {
  font-size: 2.75rem;
  color: #776e65;
  line-height: 1;
  margin-bottom: 1rem;
  padding-top: 2.5rem;
}
div.app > p {
  font-size: 1rem;
  color: #776e65;
  line-height: 1.25;
  padding-bottom: 2.5rem;
  opacity: 0.75;
}
@media only screen and (max-width: 550px) {
  div.app > h1 {
    margin-bottom: 0.65rem;
    padding-top: 1.25rem;
    font-size: 2rem;
  }
  div.app > p {
    padding-bottom: 1.25rem;
    font-size: 0.85rem;
  }
}

div.container {
  display: inline-block;
  width: 950px;
  padding: 1rem;
  padding-top: 0;
  box-sizing: border-box;
}
@media only screen and (max-width: 950px) {
  div.container {
    width: 100%;
  }
}

div.milestones {
  width: calc(550px - 2rem);
  box-sizing: border-box;
  margin: 2rem 0;
}
div.milestones h1 {
  text-align: center;
  display: block;
  font-size: 1.5rem;
  color: #776e65;
  font-weight: 700;
}
div.milestones h1 .tile {
  display: inline;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  margin: 0 0.75rem;
}

div.game {
  width: calc(550px - 2rem);
  height: calc(550px - 2rem);
  background-color: #bbada0;
  box-sizing: border-box;
  padding: 0.5rem;
  font-size: 0;
  border-radius: 5px;
  max-width: 100%;
}
@media only screen and (max-width: 950px) {
  div.game {
    margin: 0 auto;
  }
  div.milestones {
    width: 100%;
  }
}
@media only screen and (max-width: 550px) {
  div.game {
    width: calc(100vw - 2rem);
    height: calc(100vw - 2rem);
  }
  div.milestones {
    zoom: 85%;
  }
}
div.game div {
  border-radius: 5px;
  background-color: rgba(238, 228, 218, 0.35);
  margin: 0.5rem;
  width: calc(25% - 1rem);
  height: calc(25% - 1rem);
  display: flex;
  align-items: center;
  justify-content: center;
  float: left;
  box-sizing: border-box;
  font-weight: 700;
  font-size: 48px;
  color: #776e65;
  text-align: center;
}
@media only screen and (max-width: 520px) {
  div.game {
    padding: 0.3rem;
  }
  div.game div {
    margin: 0.3rem;
    width: calc(25% - 0.6rem);
    height: calc(25% - 0.6rem);
  }
}
div.num2 {
  background: #eee4da !important;
  box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0);
}
div.num4 {
  background: #ede0c8 !important;
  box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0);
}
div.num8 {
  color: #f9f6f2 !important;
  background: #f2b179 !important;
}
div.num16 {
  color: #f9f6f2 !important;
  background: #f59563 !important;
}
div.num32 {
  color: #f9f6f2 !important;
  background: #f67c5f !important;
}
div.num64 {
  color: #f9f6f2 !important;
  background: #f65e3b !important;
}
@media screen and (max-width: 520px) {
  div.game > div.num2,
  div.game > div.num4,
  div.game > div.num8,
  div.game > div.num16,
  div.game > div.num32,
  div.game > div.num64 {
    font-size: 28px;
  }
}
div.num128 {
  color: #f9f6f2 !important;
  background: #edcf72 !important;
  box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.2381), inset 0 0 0 1px rgba(255, 255, 255, 0.14286);
}
div.game > div.num128 {
  font-size: 45px;
}
@media screen and (max-width: 520px) {
  div.game > div.num128 {
    font-size: 25px;
  }
}
div.num256 {
  color: #f9f6f2 !important;
  background: #edcc61 !important;
  box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.31746), inset 0 0 0 1px rgba(255, 255, 255, 0.19048);
}
div.game > div.num256 {
  font-size: 45px;
}
@media screen and (max-width: 520px) {
  div.game > div.num256 {
    font-size: 25px;
  }
}
div.num512 {
  color: #f9f6f2 !important;
  background: #edc850 !important;
  box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.39683), inset 0 0 0 1px rgba(255, 255, 255, 0.2381);
}
div.game > div.num512 {
  font-size: 45px;
}
@media screen and (max-width: 520px) {
  div.game > div.num512 {
    font-size: 25px;
  }
}
div.num1024 {
  color: #f9f6f2 !important;
  background: #edc53f !important;
  box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.47619), inset 0 0 0 1px rgba(255, 255, 255, 0.28571);
}
div.game > div.num1024 {
  font-size: 35px;
}
@media screen and (max-width: 520px) {
  div.game > div.num1024 {
    font-size: 20px;
  }
}
div.num2048 {
  color: #f9f6f2 !important;
  background: #edc22e !important;
  box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.55556), inset 0 0 0 1px rgba(255, 255, 255, 0.33333);
}
div.game > div.num2048 {
  font-size: 35px;
}
@media screen and (max-width: 520px) {
  div.game > div.num2048 {
    font-size: 20px;
  }
}
div.num4096,
div.num8192,
div.num16384,
div.num32768,
div.num65536 {
  color: #f9f6f2 !important;
  background: #3c3a32 !important;
}
div.game > div.num4096,
div.game > div.num8192,
div.game > div.num16384,
div.game > div.num32768,
div.game > div.num65536 {
  font-size: 30px;
}
@media screen and (max-width: 520px) {
  div.game > div.num4096,
  div.game > div.num8192,
  div.game > div.num16384,
  div.game > div.num32768,
  div.game > div.num65536 {
    font-size: 15px;
  }
}

div.left {
  display: block;
  width: 550px;
  float: left;
  height: auto;
}

div.right {
  display: block;
  float: left;
  width: 350px;
}

@media only screen and (max-width: 950px) {
  div.left,
  div.right {
    width: 100%;
    clear: both;
  }
  div.right {
    margin-top: 1rem;
  }
}

div.right div.main {
  overflow: hidden;
  display: flex;
  height: calc(550px - 2rem);
  flex-direction: column;
}

div.right div.toparea {
  display: block;
  width: 100%;
  float: left;
  box-sizing: border-box;
  font-family: 'Ubuntu Mono', monospace;
  color: #776e65;
  padding-bottom: 0.75rem;
  padding-top: 0.25rem;
  border-bottom: 1px solid #bbada0;
}
div.right div.toparea input,
div.right div.toparea button,
div.right div.toparea button p {
  border: none;
  background-color: transparent;
  display: block;
  float: left;
  font-family: 'Ubuntu Mono', monospace;
  width: auto;
}
div.right div.toparea button {
  cursor: pointer;
  float: right;
  width: auto !important;
}

div.right div.toparea button p {
  display: none;
}
body:not(.restart-button-available).paused div.right div.toparea button p.paused,
body:not(.restart-button-available):not(.paused) div.right div.toparea button p.not-paused,
body.restart-button-available div.right div.toparea button p.restart {
  display: block;
}

div.right div.toparea input,
div.right div.toparea button {
  width: 3.5rem;
  margin-left: 0.5rem;
  outline: none;
  opacity: 0.8;
  background-color: #776e65;
  color: #f9f6f2 !important;
  padding: 0 0.45rem !important;
  border-radius: 3px;
  font-size: 0.9rem;
}

body:not(.restart-button-available).paused div.right div.toparea button {
  background-color: #27ae60;
}
body:not(.restart-button-available):not(.paused) div.right div.toparea button {
  background-color: #e74c3c;
}
body.restart-button-available div.right div.toparea button {
  background-color: #f39c12;
}

div.right div.toparea input:focus {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  div.right div.toparea button:hover {
    opacity: 1;
  }
}

div.right div.toparea > * {
  font-family: 'Ubuntu Mono', monospace;
  display: block;
  float: left;
  height: 1.5rem;
  line-height: 1.5rem;
  font-size: 1rem;
}
div.right div.console {
  height: calc(550px - 5.125rem);
  width: 100%;
  padding: 0;
  padding-top: 1rem;
  box-sizing: border-box;
  font-size: 1rem;
  line-height: 1.375;
  text-align: left;
  overflow-y: hidden;
  color: #776e65;
  flex-grow: 1;
}
body.paused div.right div.console,
body.restart-button-available div.right div.console {
  overflow-y: auto;
}
div.right div.console div {
  padding: 0.6rem 0.8rem;
  display: block;
  float: left;
  width: 100%;
  overflow: auto;
  background-color: #eee4da;
  border-radius: 5px;
  box-sizing: border-box;
}
div.right div.console div,
div.right div.console div > * {
  font-family: 'Ubuntu Mono', monospace;
}
div.right div.console div span {
  opacity: 0.65;
}
div.right div.console div:not(:last-child) {
  margin-bottom: 1rem;
}

div.right div.meta {
  margin: 2rem 0;
}
div.right div.meta p {
  color: #776e65;
  font-size: 0.85rem;
  line-height: 1.5;
}

@media only screen and (max-width: 550px) {
  div.right div.meta {
    margin: 1rem 0;
  }
}

.separator {
  position: relative;
  height: 1.25rem;
  color: #776e65;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.75;
}
.separator span {
  height: 1.25rem;
  display: inline-block;
  line-height: 1.25rem;
  padding: 0 1rem;
  background-color: #faf8ef;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.separator:before {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  top: 50%;
  left: 0;
  background-color: #776e65;
  z-index: -1;
  opacity: 0.25;
}

div.bottom {
  margin-top: 2.5rem;
  padding: 0 calc(((100% - 950px) / 2) + 1rem);
}
@media only screen and (max-width: 950px) {
  div.bottom {
    padding: 0 1rem;
  }
}

div.bottom h1 {
  color: #776e65;
  font-size: 2rem;
  margin-bottom: 2rem;
}

div.bottom > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) {
  text-align: left;
  margin-bottom: 2rem;
  color: #776e65;
  font-size: 1.1rem;
  line-height: 1.65;
  opacity: 0.85;
}

div.bottom ul {
  margin-left: 2rem;
}

div.bottom a:not(.styled) {
  text-decoration: none;
  color: #0e91ff;
  border-bottom: 1px dotted #0e91ff;
  user-select: text;
}
div.bottom a:not(.styled):hover::selection {
  border-bottom-style: solid;
  background-color: #0e91ff;
  color: var(--white-color);
}
div.bottom a:not(.styled):hover {
  border-bottom-style: solid;
}

div.bottom a.styled {
  display: flex;
  width: 100%;
  min-height: 2rem;
  text-decoration: none;
  padding: 1rem 1.5rem;
  box-sizing: border-box;
  border-radius: 4px;
  background-color: #eee4da;
  opacity: 0.8;
  transition: opacity 0.2s ease-in-out, color 0.2s ease-in-out, fill 0.2s ease-in-out;
  color: #5f5850;
  fill: #5f5850;
}
div.bottom a.styled:hover {
  opacity: 1;
}
div.bottom a.styled > span.text {
  flex-basis: 100%;
  padding-right: 0.6rem;
  font-size: 1.25rem;
  line-height: 1.65;
}
div.bottom a.styled > span.arrow {
  flex-basis: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease-in-out;
}
div.bottom a.styled:hover > span.arrow {
  transform: translateX(0.5rem);
}
div.bottom a.styled > span.arrow > * {
  flex-basis: 100%;
}

div.bottom p.start-text {
  line-height: 1.65;
  margin-bottom: 0.4rem;
}
div.bottom p.start-text.default-margin {
  margin-bottom: 2.5rem;
}

div.bottom .links {
  text-align: center;
  font-size: 0;
}
div.bottom .links a {
  font-size: 1rem;
  color: #fff;
  text-decoration: none !important;
  border: none !important;
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  background-color: #0e91ff;
  opacity: 0.85;
  margin: 0 0.3rem;
  box-sizing: border-box;
}

@media only screen and (max-width: 520px) {
  div.bottom .links a {
    margin: 0;
    margin-bottom: 0.6rem;
    width: 100%;
  }
}

div.bottom .links a:hover {
  opacity: 1;
}

div.scroll-down {
  position: fixed;
  bottom: 0.5rem;
  right: 0.5rem;
  background-color: #eee4da;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: #776e65;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.5rem;
  border-radius: 5px;
  transition: opacity 0.2s ease-in-out;
}
